package com.xrui.hbase.util;

/**
 * An interface for a wall clock.
 */
public abstract class Clock {

  /**
   * Package-private default constructor. Clients should use Clock.getDefaultClock()
   * to create a new Clock instance.
   */
  Clock() {
  }

  /**
   * Gets the current time.
   *
   * @return The current time.
   */
  public abstract long getTime();

  /**
   * @return a default clock instance that uses the system clock.
   */
  public static Clock getDefaultClock() {
    return new DefaultClock();
  }
}
